﻿/*
 * Created by SharpDevelop.
 * User: amb
 * Date: 30/05/2014
 * Time: 15:34
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Drawing.Design;
using System.Windows.Forms;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;

namespace JdFormsDll
{

    partial class MyForm
    {

        #region Hidden Properties

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new Padding Padding
        {
            get { return base.Padding; }
            set
            {
                base.Padding = new Padding(7, 44, 7, 7);
                this.Invalidate();
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new FormBorderStyle FormBorderStyle
        {
            get { return base.FormBorderStyle; }
            set { base.FormBorderStyle = FormBorderStyle.None; }
        }


        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new bool DoubleBuffered
        {
            get { return base.DoubleBuffered; }
            set { base.DoubleBuffered = true; }
        }

        #endregion Hidden Properties

        #region Replaced Properties

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Text")]
        public new string Text
        {
            get { return base.Text; }
            set
            {
                base.Text = value;
                this.Invalidate();
            }

        }

        private Bitmap _IconImage = null;

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        internal Bitmap IconImage
        {
            get { return this._IconImage; }
            set
            {
                this._IconImage = value;
                base.Icon = null;
                this.Icon = null;
                this.Invalidate();
            }
        }

        private static Icon EmptyIcon()
        {
            Icon ico = null;
            using (Bitmap bmp = new Bitmap(24, 24))
            {
                bmp.MakeTransparent(Color.White);
                IntPtr ip = bmp.GetHicon();
                ico = Icon.FromHandle(ip);
            }
            return ico;
        }

        private Icon _Icon = EmptyIcon();

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Icon")]
        public new Icon Icon
        {
            get { return this._Icon; }
            set
            {
                this._Icon = value;
                base.Icon = value;
                this.Invalidate();
            }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide Icon")]
        public new bool ShowIcon
        {
            get { return base.ShowIcon; }
            set
            {
                base.ShowIcon = value;
                base.Invalidate();
            }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide MaximizeBox")]
        public new bool MaximizeBox
        {
            get { return base.MaximizeBox; }
            set
            {
                base.MaximizeBox = value;
                base.Invalidate();
            }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide MinimizeBox")]
        public new bool MinimizeBox
        {
            get { return base.MinimizeBox; }
            set
            {
                base.MinimizeBox = value;
                base.Invalidate();
            }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide ControlBox")]
        public new bool ControlBox
        {
            get { return base.ControlBox; }
            set
            {
                base.ControlBox = value;
                base.Invalidate();
            }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption and Client Area Color")]
        public new Color BackColor
        {
            get { return base.BackColor; }
            set
            {
                base.BackColor = value;
                this.Invalidate();
            }
        }

        #endregion Replaced Properties

        #region Custom Properties

        private Color _BackColorShadow = Color.Gray;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption and Client Area Color Shadow")]
        public Color BackColorShadow
        {
            get { return this._BackColorShadow; }
            set
            {
                this._BackColorShadow = value;
                this.Invalidate();
            }
        }

        private bool _IsResizable = true;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("I can resize the form")]
        public bool IsResizable
        {
            get { return this._IsResizable; }
            set
            {
                if(value)
                {
                	base.MinimumSize = (this.MinimumSize == Size.Empty) ? new Size(200, 100) : this.MinimumSize;
                	base.MaximumSize = Size.Empty;
                }
                else
                {
                	base.MinimumSize = base.Size;
                	base.MaximumSize = base.Size;
                }
                this._IsResizable = value;
                base.Invalidate();
            }
        }

        private Color _BorderColor = Color.Gray;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Window Color")]
        public Color BorderColor
        {
            get { return this._BorderColor; }
            set
            {
                this._BorderColor = value;
                this.Invalidate();
            }
        }

        private Color _TextCaptionColor = Color.Black;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Color")]
        public Color TextCaptionColor
        {
            get { return this._TextCaptionColor; }
            set
            {
                this._TextCaptionColor = value;
                this.Invalidate();
            }
        }

        private Color _TextCaptionColorShadow = Color.DimGray;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Shadow Color")]
        public Color TextCaptionColorShadow
        {
            get { return this._TextCaptionColorShadow; }
            set
            {
                this._TextCaptionColorShadow = value;
                this.Invalidate();
            }
        }

        private Shadow _TextCaptionShadow = Shadow.Normal;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Text Shadow")]
        public Shadow TextCaptionShadow
        {
            get { return this._TextCaptionShadow; }
            set
            {
                this._TextCaptionShadow = value;
                this.Invalidate();
            }
        }

        private ContentAlignment _TextCaptionAlignment = ContentAlignment.MiddleCenter;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Text Alignment")]
        public ContentAlignment TextCaptionAlignment
        {
            get { return this._TextCaptionAlignment; }
            set
            {
                this._TextCaptionAlignment = value;
                this.Invalidate();
            }
        }

        private Font _TextCaptionFont = new Font("Verdana", 10.0f, FontStyle.Bold | FontStyle.Italic);

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Text Font")]
        public Font TextCaptionFont
        {
            get { return this._TextCaptionFont; }
            set
            {
                this._TextCaptionFont = value;
                this.Invalidate();
            }
        }

        private Border3DStyle _BorderStyle = Border3DStyle.Adjust;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Form Border Style")]
        public Border3DStyle BorderStyle
        {
            get { return this._BorderStyle; }
            set
            {
                this._BorderStyle = value;
                this.Invalidate();
            }
        }

        private Percent _CaptionBorderRoundPercent = Percent.Percent20;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Caption Rounded Corner Percent")]
        public Percent CaptionBorderRoundPercent
        {
            get { return this._CaptionBorderRoundPercent; }
            set
            {
                this._CaptionBorderRoundPercent = value;
                this.Invalidate();
            }
        }

        private Percent _ColorsDifferencePercent = Percent.Percent10;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Difference Percent between BackColor and BackColorShadow")]
        public Percent ColorsDifferencePercent
        {
            get { return this._ColorsDifferencePercent; }
            set
            {
                this._ColorsDifferencePercent = value;
                this.Invalidate();
            }
        }

        private bool _ShowClientBorder = true;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide Client Area Border")]
        public bool ShowClientBorder
        {
            get { return this._ShowClientBorder; }
            set
            {
                this._ShowClientBorder = value;
                this.Invalidate();
            }
        }
        
        private bool _ShowCaptionBorder = true;
        
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide Caption Area Border")]
        public bool ShowCaptionBorder
        {
        	get { return this._ShowCaptionBorder; }
        	set
        	{
        		this._ShowCaptionBorder = value;
        		this.Invalidate();
        	}
        }

        private bool _IsMoveable = true;

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("I can move the form")]
        public bool IsMoveable
        {
            get { return this._IsMoveable; }
            set
            {
                this._IsMoveable = value;
                this.Invalidate();
            }
        }

        private bool _ShowTooltip = true;
        
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("JdForm")]
        [Description("Show / Hide form Tooltips")]
        public bool ShowTooltip
        {
        	get { return this._ShowTooltip; }
        	set
        	{
        		this._ShowTooltip = value;
        		this.Invalidate();
        	}
        }
      
        #endregion Custom Properties

    }
}
